package com.xyoto.takeawayBusiness.mapper;

import com.xyoto.takeawayBusiness.entity.ShoppingType;
import com.xyoto.takeawayBusiness.entity.UserCache;
import com.xyoto.takeawayBusiness.entity.UserShop;
import com.xyoto.takeawayBusiness.vo.ShoppingFrontVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author Administrator
 */
@Mapper
public interface UserShopMapper {

    /**
     * 通过openid查询用户是否存在
     *
     * @param openid openid
     * @return
     */
    Integer userExistStatus(String openid);

    /**
     * 新增商户用户
     *
     * @param userShop 商户用户
     * @return
     */
    Integer saveUserShop(UserShop userShop);

    /**
     * 根据openid获取商户用户信息
     *
     * @param openid openid
     * @return
     */
    UserCache getUserShopMessageByOpenid(String openid);

    /**
     * 根据用户id查询店铺id
     * @return
     */
    Integer findShopIdByUserId(Integer userShopId);

    /**
     * 根据店铺id查询菜单
     * @param shopId
     * @return
     */
    List<ShoppingType> getMenu(Integer shopId);

    /**
     * 根据店铺id和类别id查询商品列表
     * @param typeId
     * @param shopId
     * @return
     */
    List<ShoppingFrontVO> findShoppingById(Integer typeId, Integer shopId);
}
